package com.open.party.cloud;

import com.open.party.cloud.model.data.LocalCache;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;

public class ServerConfig {
    public static final String SERVER_IP = "https://www.lpszzb.gov.cn/"; //
//    public static final String SERVER_IP = "http://58.16.181.23:10086/"; //

    public static final String SERVER_URL = SERVER_IP + "lpsdjapi/"; //

//    public static final String SERVER_URL = "http://192.168.1.34:21002/lpsdjapi/"; //
//    private static final String SERVER_IP = "http://58.16.181.23:10086/"; // 测服
//    public static final String SERVER_URL = SERVER_IP + "zyhhgapi/";

    /**
     * 构建服务请求头部信息
     */
    public static HashMap<String, String> getHeader() {
        HashMap<String, String> headerMap = new HashMap<>();
        String token = LocalCache.getToken();
        headerMap.put("token", token);
        return headerMap;
    }

    public static HashMap<String, String> getHeaderTest() {
        HashMap<String, String> headerMap = new HashMap<>();
        String token = LocalCache.getToken();
        headerMap.put("token", "test");
        return headerMap;
    }

    @NotNull
    public static String getFilePreviewUrl(String url) {
//        return SERVER_IP +"file-view/onlinePreview?url="+ url + "&officePreviewType=pdf";
        return SERVER_IP +"file-view/onlinePreview?url="+ url + "&officePreviewType=pdf";//文件预览暂时就用这个
        // "http://58.16.181.23:10086/onlinePreview?url="+url+"&officePreviewType=pdf";
//        return "http://39.108.98.167:10086/zyhhg-center/admin/index";
//        return "http://192.168.1.24:8012/onlinePreview?url=" + url + "&officePreviewType=pdf";
//        return "http://192.168.1.165:9443/onlinePreview?url=" + url;
//        return "http://www.xdocin.com/xdoc?_func=to&amp;_format=html&_cache=1&_xdoc=" + url;
    }
    @NotNull
    public static String getArticleUrl(String id) {
        // http://58.16.181.23:10086/lps-web/biz/location.html?id=123#/location
        return SERVER_IP + "lps-web/biz/location.html?id=" + id + "#/location";
    }

    public static String getArticleInfoUrl(String id) {
        // http://58.16.181.23:10086/lps-web/biz/location.html?id=123#/location
        return SERVER_IP + "lpsweb/biz/news.html?id=" + id + "#/newsDetail";
//        return SERVER_IP + "lps-web/biz/location.html?id=" + id + "#/location";
    }

//    public static String getProtocolUrl() {
//        return SERVER_IP + "zyhhg/biz/toArticle.html#/userAgreement";
//    }
}
